def dfs(idx, time):  # 第几架飞机，当前时间
    global flag
    if idx == n:
        flag = True
        return
    if flag:
        return
    for i in range(n):
        if vis[i] == 0:
            if t[i] + d[i] < time:
                return
            vis[i] = 1
            dfs(idx + 1, max(time, t[i]) + l[i])
            vis[i] = 0

T = int(input())
t = [0] * 20
d = [0] * 20
l = [0] * 20

for i in range(T):
    n = int(input())
    for j in range(n):
        t[j], d[j], l[j] = map(int, input().split())
    vis = [0] * n
    flag = False
    dfs(0, 0)
    if flag:
        print("YES")
    else:
        print("NO")